package com.wenhao.zhaoshang;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;

/**
 * @author Wenhao Tong
 * @create 2021-08-08 19:34
 */
public class Main2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] a = new int[n];
        int[] b = new int[n];
        for (int i = 0;i < n;i++) {
            a[i] = scanner.nextInt();
        }
        for (int i = 0;i < n;i++) {
            b[i] = scanner.nextInt();
        }
        Arrays.sort(a);
        Arrays.sort(b);
        int m = 1;
        while (m < n) {
            int count = 0;
            for (int i = 0;i < m;i++) {
                if (a[i] > b[m / 2 + i]) {
                    count++;
                }
            }
        }
        System.out.println(-1);
    }
}
